<?php

class Filter_TableEndsWith {

	var $sEndsWithString;
	
	function Filter_TableEndsWith( $sEndsWithString ){
		$this->sEndsWithString = $sEndsWithString;	
	}

	function ShouldIncludeTable( $sTableName ) {

		// could be refactored
		
		$sLengthOfSearch = strlen( $this->sEndsWithString );
		$sLengthOfTable  = strlen( $sTableName );

		return ( strtoupper( substr( $sTableName, ( $sLengthOfTable - $sLengthOfSearch ) ) ) === strtoupper( $this->sEndsWithString ) );
	}
}


?>